package com.lanou.service.impl;

import com.lanou.bean.NewDiary;
import com.lanou.mapper.NewDiaryMapper;
import com.lanou.service.NewDiaryService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class NewDiaryServiceImpl implements NewDiaryService {

    @Resource
    private NewDiaryMapper newDiaryMapper;


    /**
     * zfy
     * 装修攻略页面 显示全部的业主日记
     *
     * @return
     */
    @Override
    public List<NewDiary> getAllDiary() {
        return newDiaryMapper.getAllDiary();
    }

    /**
     * zfy
     * 根据日记的Id 获取该片业主日记的全部内容
     *
     * @param newDiaryId
     * @return
     */
    @Override
    public NewDiary getDiaryById(Integer newDiaryId) {
        return newDiaryMapper.getDiaryById(newDiaryId);
    }

    @Override
    public void addClick(Integer newDiaryId) {

        newDiaryMapper.addClick(newDiaryId);

    }

    @Override
    public void addCollect(Integer newDiaryId) {
        newDiaryMapper.addCollect(newDiaryId);
    }

    @Override
    public void minusCollect(Integer newDiaryId) {
        newDiaryMapper.minusCollect(newDiaryId);
    }
}
